package test;
import nme.utils.ByteArray;

/**
 * ...
 * @author liwei
 * html不支持压缩
 */

class TestBytearray extends TestBase
{
	override public function start():Void 
	{
		super.start();
		var ba:ByteArray = new ByteArray();
		ba.writeBoolean(true);
		ba.writeByte(123);
		ba.writeDouble(0.44);
		ba.writeInt(98765);
		ba.writeShort(200);
		ba.writeUTF("hello");
		ba.writeUTFBytes("haxe");
		log("length" + ba.length);
		ba.position = 0;
		log("boolean " + ba.readBoolean());
		log("byte " + ba.readByte());
		log("double " + ba.readDouble());
		log("int " + ba.readInt());
		log("short " + ba.readShort());
		log("utf " + ba.readUTF());
		log("utfbytes " + ba.readUTFBytes(ba.bytesAvailable));
	}
}